package com.sixbro.shiro.session.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * <p>
 *
 * </p>
 *
 * @Author: Mr.Lu
 * @Since: 2020/6/17 16:19
 */
@Controller
@RequestMapping("/user")
public class UserController {
    private static final Logger _logger = LoggerFactory.getLogger(UserController.class);


    @RequestMapping(value = "/add")
    @RequiresPermissions(value = "user:add")
    public String add(){

        _logger.info("用户添加");

        return "modules/user/add";
    }


    @RequestMapping(value = "/delete")
    @RequiresPermissions(value = "user:delete")
    public String delete(){

        _logger.info("用户删除");

        return "modules/user/add";
    }


    @RequestMapping(value = "/list")
    @RequiresPermissions(value = "user:query")
    public String list(){

        _logger.info("用户列表");

        return "modules/user/add";
    }


    @RequestMapping(value = "/update")
    @RequiresRoles(value = "admin")
    //@RequiresPermissions(value = "user:update")
    public String update(){

        _logger.info("用户更新");

        return "modules/user/add";
    }
}
